<template>
  <div class="course-list">
    <div v-for="course in courses" :key="course.id" class="course-item">
      <h3>{{ course.name }}</h3>
      <p>{{ course.date }}</p>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CourseList',
  data() {
    return {
      courses: [
        { id: 1, name: '计算机网络基础', date: '周三 19:00' },
        { id: 2, name: '计算机网络基础', date: '周三 19:00' },
        { id: 3, name: '计算机网络基础', date: '周三 19:00' },
        { id: 4, name: '计算机网络基础', date: '周三 19:00' },
      ]
    };
  }
};
</script>

<style>
.course-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.course-item {
  background-color: #fff;
  padding: 1rem;
  flex: 1 1 calc(25% - 1rem);
  box-sizing: border-box;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.course-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
</style>
